package com.zbf.web;

import com.zbf.common.ResponseResult;
import com.zbf.common.ResultStatus;
import com.zbf.dao.UserDaoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2021/6/25  18:50
 * 描述:
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    UserDaoMapper userDaoMapper;

    @RequestMapping("userList")
    public ResponseResult getUserlist(@RequestBody Map<String,String> map){


        List<Map<String, Object>> userList = userDaoMapper.getUserList();

        ResponseResult responseResult = ResponseResult.getResponseResult().setCode(ResultStatus.AUTH_SUCCESS.getCode())
                .setMsg(ResultStatus.AUTH_SUCCESS.getMsg())
                .setResult(userList);

        return responseResult;
    }

}
